home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3496 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  60 lines

  1. Path: ulke.hiMolde.no!ulke!espen
  2. From: Espen.Berntsen@himolde.no (Nameless)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Referances troubble
  5. Date: 20 Feb 1996 14:09:59 GMT
  6. Organization: Molde College, Department of Computer Science
  7. Message-ID: <1266.6624T117T1455@himolde.no>
  8. NNTP-Posting-Host: ulke.himolde.no
  9. X-Newsreader: THOR 2.21 (Amiga;SOUP)
  10. Originator: espen@ulke
  11.  
  12. Ok, I have aslight problem with references. The problem is that I have to pass a
  13. few pointers to a subroutine, where things are done to them, and then they are
  14. passed back. Now, what I hoped would work was something like this
  15.  
  16. =========== Cut cut cut ===============================
  17. #include <stdio.h>
  18. #include <proto/dos.h>
  19. #include <proto/exec.h>
  20. #include <exec/memory.h>
  21.  
  22. void Tester(void &Testering)
  23. {
  24.     printf("%i\n",Testering);
  25.     Testering = AllocMem(100, MEMF_CHIP|MEMF_CLEAR);
  26.     printf("%i\n",Testering);
  27. }
  28.  
  29. void main(void)
  30. {
  31.     void *Test;
  32.  
  33.     printf("%i\n",Test);
  34.     Tester(Test);
  35.  
  36.     printf("%i\n",Test);
  37. //   FreeMem(Test, 100);
  38. }
  39. ====================== cut cut cut =======================
  40. Now, this of course don't work. But Ill be damned if I know how to get it to
  41. work. By reading the test program you should hopefully be able to understand
  42. what I mean. PLEASE can someone help..
  43.  
  44. And no, I can't just return the value, 'cause there will be many such values.
  45. And I don't want to return a structure.
  46.  
  47.  
  48.  
  49. --
  50. This excellent message was brought to you at 18-Feb-96 21:29:25 by
  51.  
  52. Nameless@ask.himolde.no <> Nameless @ IRC <> http://www.himolde.no/~espen
  53. =============================================================================
  54. The thoughtless are rarely wordless.
  55. -- 
  56.  
  57. Nameless@ask.hiMolde.no  <> irc: Nameless <> http://www.himolde.no/~espen
  58. ===========================================================================
  59. Fighting for peace is like fucking for virginity.
  60.